package com.example.javaOne;

import org.junit.jupiter.api.Test;

/**
 * 第三章的内容
 *
 */
public class ChapterThree {

    /**
     * double类型的数据
     */
    @Test
    public void testDouble(){
        System.out.println("Double.POSITIVE_INFINITY="+Double.POSITIVE_INFINITY);
        System.out.println("Double.NEGATIVE_INFINITY="+Double.NEGATIVE_INFINITY);
        System.out.println("Double.NaN="+Double.NaN);


        System.out.println(2.0-1.1);

        System.out.println("==============");
        int i =123456789;
        float f =i;

        System.out.println(f);

        double k =9.98;
        int j =(int)k;
        System.out.println(j);


        int round = (int) Math.round(k);
        System.out.println(round);


    }

    /**
     * 测试string类型的api
     */
    @Test
    public void testStringApi(){
        String s ="helloworld";
        char c = s.charAt(0);
        System.out.println(c);
        char c1 = s.charAt(s.length()-1);
        System.out.println(c1);

        int i = s.codePointAt(0);
        System.out.println(i);
        int count =s.re
    }

}
